<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<html>
<head>
<meta charset="UTF-8">
    <link href="${pageContext.request.contextPath}/tool/css/bootstrap.css" rel="stylesheet" />
	<link href="${pageContext.request.contextPath}/tool/css/login-register.css" rel="stylesheet" />
	<script src="${pageContext.request.contextPath}/tool/js/jquery-1.10.2.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/tool/js/bootstrap.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/tool/js/login-register.js" type="text/javascript"></script>
	
<title>Insert title here</title>
<style type="text/css">
	table{
		border-top:1px solid #000
	}
	h1{
		text-align: center;
	}
</style>
</head>
<body id="indexbody">
<h1>数据库结构及其数据</h1>
<div >
	<div class="container">
	  <div class="row">
		  <div class="col-xs-6">
		  	<table class="table">
		  		<caption><h1>学生表（student）</h1></caption>
			    <thead>
			    <tr>
			        <th>编号</th>
			        <th>姓名</th>
			        <th>性别</th>
			        <th>年龄</th>
			        <th>电话</th>
			        <th>学号</th>
			        <th>密码</th>
			        <th>班级的ID</th>
			    </tr>
			    <tr>
			        <th>id</th>
			        <th>name</th>
			        <th>gender</th>
			        <th>age</th>
			        <th>number</th>
			        <th>sn</th>
			        <th>password</th>
			        <th>bj_id</th>
			    </tr>
			    </thead>
			    <tbody>
			    <c:forEach items="${student }" var="c">
				    <tr>
				        <td>${c.id }</td>
				        <td>${c.name }</td>
				        <td>${c.gender }</td>
				        <td>${c.age }</td>
				        <td>${c.number }</td>
				        <td>${c.sn }</td>
				        <td>${c.password }</td>
				        <td>${c.bj.id }</td>
				    </tr>
			    </c:forEach>
			    </tbody>
			</table>
		  </div>
		  
		  <div class="col-xs-6">
		  		<table class="table">
		  		<caption><h1>任课教师表（teacher）</h1></caption>
			    <thead>
			    <tr>
			        <th>编号</th>
			        <th>教师姓名</th>
			        <th>所教课程</th>
			        <th>账号</th>
			        <th>密码</th>
			    </tr>
			    <tr>
			        <td>id</td>
			        <th>tcname</th>
			        <td>course</td>
			        <td>tcusername</td>
			        <td>tcpassword</td>
			    </tr>
			    </thead>
			    <tbody>
			    <c:forEach items="${teacher }" var="c">
				    <tr>
				    	<td>${c.id }</td>
				    	<td>${c.tcname }</td>
				    	<td>${c.course }</td>
				    	<td>${c.tcuser }</td>
				    	<td>${c.tcpassword }</td>
				    </tr>
			    </c:forEach>
			    </tbody>
			</table>
		  </div>
		</div> 
	</div>
</div>
<div >
	<div class="container">
	  <div class="row">
		  <div class="col-md-4">
		  	<table class="table">
		  		<caption><h1>班级表(class)</h1></caption>
			    <thead>
			    <tr>
			        <th>编号</th>
			        <th>班级</th>
			        <th>班主任</th>
			    </tr>
			    <tr>
			        <th>id</th>
			        <th>bjname</th>
			        <th>bjteacher</th>
			    </tr>
			    </thead>
			    <tbody>
			    <c:forEach items="${bj }" var="c">
				    <tr>
				        <td>${c.id }</td>
				        <td>${c.bjname }</td>
				        <td>${c.bjteacher }</td>
				    </tr>
			    </c:forEach>
			    </tbody>
			</table> 
		  </div>
		  <div class="col-md-4">
		  	<table class="table">
		  		<caption><h1>最高管理员（admin）</h1></caption>
			    <thead>
			    <tr>
			        <th>编号</th>
			        <th>姓名</th>
			        <th>账号</th>
			        <th>密码</th>
			    </tr>
			     <tr>
			        <th>ID</th>
			        <th>name</th>
			        <th>username</th>
			        <th>password</th>
			    </tr>
			    </thead>
			    <tbody>
			    <c:forEach items="${admin }" var="c">
				    <tr>
				        <td>${c.id }</td>
				        <td>${c.name }</td>
				        <td>${c.username }</td>
				        <td>${c.password }</td>
				    </tr>
			    </c:forEach>
			    </tbody>
			</table>
		  </div>
		  <div class="col-md-4">
		  	<table class="table">
		  		<caption><h1>成绩表（grade）</h1></caption>
			    <thead>
			    <tr>
			        <th>编号</th>
			        <th>成绩</th>
			        <th>学生ID</th>
			        <th>教师ID(课程ID)</th>
			    </tr>
			    <tr>
			        <th>ID</th>
			        <th>grade</th>
			        <th>student_id</th>
			        <th>teacher_id</th>
			    </tr>
			    </thead>
			    <tbody>
			    <c:forEach items="${grade }" var="c">
			    	<tr>
			    		<td>${c.id }</td>
				        <td>${c.grade }</td>
				        <td>${c.student.id }</td>
				        <td>${c.teacher.id}</td>
				    </tr>
			    </c:forEach>
			    </tbody>
			</table>
		  </div>
		</div>
	</div>
</div>

</body>
</html>